
RegRead("HKLM\SOFTWARE\PlayOnlineUS\SquareEnix\FinalFantasyXI", "0001")
If @error = 1 Then
	Global $resx = RegRead("HKLM\SOFTWARE\PlayOnlineEU\SquareEnix\FinalFantasyXI", "0001")
	Global $resy = RegRead("HKLM\SOFTWARE\PlayOnlineEU\SquareEnix\FinalFantasyXI", "0002")
	Global $install = RegRead("HKLM\SOFTWARE\PlayOnlineEU\Installfolder", "0001")
	$useu = ("EU")
Else
	Global $resx = RegRead("HKLM\SOFTWARE\PlayOnlineUS\SquareEnix\FinalFantasyXI", "0001")
	Global $resy = RegRead("HKLM\SOFTWARE\PlayOnlineUS\SquareEnix\FinalFantasyXI", "0002")
	Global $install = RegRead("HKLM\SOFTWARE\PlayOnlineUS\Installfolder", "0001")
	$useu = ("US")
EndIf

Global $resa = @DesktopWidth
Global $resb = @DesktopHeight
Global $resadded = $resx + $resy
Global $winadded = $resa + $resb


Select
	Case $resadded = 1400
		$wr = .585
		$hr = .57
		$pic = "plaunch1.bmp"
	Case $resadded = 1792
		$wr = .8
		$hr = .745
		$pic = "plaunch2.bmp"
	Case $resadded = 2016
		$wr = .89
		$hr = .84
		$pic = "plaunch3.bmp"
	Case $resadded = 2000
		$wr = 1
		$hr = .695
		$pic = "plaunch4.bmp"
	Case $resadded = 2048
		$wr = 1
		$hr = .745
		$pic = "plaunch5.bmp"
	Case $resadded = 2240
		$wr = 1
		$hr = .937
		$pic = "plaunch6.bmp"
	Case $resadded = 2304
		$wr = 1
		$hr = 1
		$pic = "plaunch.bmp"
	Case $resadded = 2128
		$wr = 1.0625
		$hr = .745
		$pic = "plaunch7.bmp"
	Case $resadded = 2384
		$wr = 1.0625
		$hr = 1
		$pic = "plaunch8.bmp"
	Case $resadded = 2340
		$wr = 1.14
		$hr = .88
		$pic = "plaunch9.bmp"
	Case $resadded = 2800
		$wr = 1.28
		$hr = 1.185
		$pic = "plaunch10.bmp"
	Case $resadded = 2730
		$wr = 1.35
		$hr = 1.03
		$pic = "plaunch11.bmp"
	Case $resadded = 3136
		$wr = 1.45
		$hr = 1.325
		$pic = "plaunch12.bmp"
	Case $resadded = 3240
		$wr = 1.45
		$hr = 1.425
		$pic = "plaunch13.bmp"
EndSelect



$PCNPC = GUICreate("Rogue Tools", 108 * $wr, 54 * $hr, 320 * $wr, 880 * $hr, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
$a = DllCall(".\BMP2RGN.dll", "int", "BMP2RGN", _
		"str", @ProgramFilesDir & "\Burnersware\Rogue Tools\Include\img\pl\" & $pic, _
		"int", 0, _
		"int", 12, _
		"int", 84)

SetWindowRgn($PCNPC, $a[0])


If ProcessExists("Rogue Tools.exe") Then
	$f = 0
Else
	MsgBox(4096, "Rogue Tools?", "You need to be running Rogue Tools in order to use this control")
	Exit
EndIf


$pc = GUICtrlCreateLabel("", 0, 0, 54 * $wr, 54 * $hr)
GUICtrlSetTip(-1, "PC")
$npc = GUICtrlCreateLabel("", 54 * $wr, 0, 54 * $wr, 54 * $hr)
GUICtrlSetTip(-1, "NPC")
GUICtrlCreatePic(@ProgramFilesDir & "\Burnersware\Rogue Tools\Include\img\pl\plaunch.bmp", 0, 0, 108 * $wr, 54 * $hr)


DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $PCNPC, "int", 500, "long", 0x00080000)
GUISetState()
While 1
	$Message = GUIGetMsg()
	If $Message = $GUI_EVENT_CLOSE Then
		DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $PCNPC, "int", 1000, "long", 0x00090000)
		Exit
	EndIf
	If $Message = $pc Then
		Run(@ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\JpPack\PCTC.exe", @ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\JpPack")
		Sleep(500)
		WinActivate("BurntPC")
		Exit
	EndIf
	If $Message = $npc Then
		Run(@ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\JpPack\NPCTC.exe", @ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\JpPack")
		Sleep(500)
		WinActivate("BurntNPC")
		Exit
	EndIf

WEnd

Func SetWindowRgn($h_win, $rgn)
	DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc ;==>SetWindowRgn

Func RunByAssoc($szFile)
	$nPos = StringInStr($szFile, ".", 0, -1)
	If Not $nPos Then Return 0
	$szExtension = StringTrimLeft($szFile, $nPos - 1)
	$szRegValue = RegRead("HKCR\" & $szExtension, "")
	If @error Then Return 0
	$szRegValue = RegRead("HKCR\" & $szRegValue & "\shell\open\command", "")
	If @error Then Return 0
	$nPos = StringInStr($szRegValue, ".exe")
	If Not $nPos Then $nPos = StringInStr($szRegValue, ".com")
	If Not $nPos Then
		$szRegValue = '"' & @ComSpec & '" /c '
	Else
		$szRegValue = StringLeft($szRegValue, $nPos + 4)
	EndIf
	If StringRight($szRegValue, 1) == '"' Then $szRegValue = $szRegValue & " "
	If StringRight($szRegValue, 1) <> ' ' Then $szRegValue = $szRegValue & " "
	If StringLeft($szFile, 1) <> '"' Then $szFile = '"' & $szFile
	If StringRight($szFile, 1) <> '"' Then $szFile = $szFile & '"'
	If Run($szRegValue & $szFile) Then Return 1
	Return 0
EndFunc ;==>RunByAssoc

